package com.xzh.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Getter;
import lombok.Setter;


import java.util.Date;

@Getter
@Setter
@TableName("students")
@JsonIgnoreProperties({"handler", "hibernateLazyInitializer"})
public class Students {
    @TableId(type = IdType.AUTO)
    private Integer studentId;

    @TableField(condition = SqlCondition.LIKE, whereStrategy = FieldStrategy.NOT_EMPTY)
    @NotBlank(message = "学生名称不可为空")
    private String studentName;

    @NotBlank(message = "邮箱不可为空")
    @Email(message = "请输入正确的邮箱格式")
    private String email;

    @NotBlank(message = "请输入手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "请输入正确的手机号")
    private String phone;

    private String major;
    private String status;
    private String grade;
    private Date createTime;
    private Date updateTime;
}
